package com.k2091.washcar.controller;


import com.k2091.washcar.entity.ServiceType;
import com.k2091.washcar.service.IServiceTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2021-06-01
 */
@RestController
@RequestMapping("/api/ServiceType")
public class ServiceTypeController {
    @Autowired
    private IServiceTypeService service;

    @RequestMapping("/getServiceTypeList")
    public List<ServiceType> getTypeList(){
        return service.selectAll();
    }

    @RequestMapping("/getprojectType")
    public String getType(Long projectId){
        return service.selectById(projectId).getName();
    }


}
